[@plaintext.layout title="QuickView"]
h1. quoting
${"It's \"quoted\" and
this is a backslash: \\"}

${'It\'s "quoted" and
this is a backslash: \\'}

h1. Escape characters.
\" \' \\ \n \r \t aaa\bbbb \f \l \g \a

xCode: "\xA9 1999-2001", "\x0A9 1999-2001", "\x00A9 1999-2001"
xCode: ${"\xA9 1999-2001" + "\x0A9 1999-2001" + "\x00A9 1999-2001"}

[#assign beanName = 'The "foo" bean.']
String BEAN_NAME = "${beanName?j_string}";

[#assign user = "Big Joe's \"right hand\""]
alert("Welcome ${user?js_string}!");

h1. Raw String
${r"${foo}"}
${r"C:\foo\bar"}

h1. Substring characters
[#assign s = "Zemian"/]
${"${s[0]} is Cool"}
${"Mama-${s[2..4]}"} [#-- inclusive!!! --]
${"Mama-${s?substring(2,4)}"} [#-- exclusive!!! --]
String size? : ${s?length} [#-- why not ?size as well?--]

h1. String to Number conversion
[#assign x="99"/]
${x?number}

h2. Number to Number
[#assign x=99/]
${(x/2)?int}
${1.1?int}
${1.999?int}
${-1.1?int}
${-1.999?int}

h1. Built-ins for string
[#assign test = "  tom & Jerry  "/]
${test?html}
${test?upper_case?html} 
${test?trim?upper_case?html} 
${test?trim?cap_first?html}

h1. Date String
[#assign test1 = "Oct 25, 1995"?date]
[#assign test2 = "3:05:30 PM"?time]
[#assign test3 = "Oct 25, 1995 03:05:00 PM"?datetime]
${test1}
${test2}
${test3}

[#assign test1 = "10/25/1995"?date("MM/dd/yyyy")]
[#assign test2 = "15:05:30"?time("HH:mm:ss")]
[#assign test3 = "1995-10-25 03:05 PM"?datetime("yyyy-MM-dd hh:mm a")]
${test1}
${test2}
${test3}

h1. String padding & replacing
[${""?left_pad(5)}]
[${"a"?left_pad(5)}]
[${"ab"?left_pad(5)}]
[${"abc"?left_pad(5)}]
[${"abcd"?left_pad(5)}]
[${"abcde"?left_pad(5)}]
[${"abcdef"?left_pad(5)}]
[${"abcdefg"?left_pad(5)}]
[${"abcdefgh"?left_pad(5)}]
[${""?left_pad(5, "-")}]
[${"a"?left_pad(5, "-")}]
[${"ab"?left_pad(5, "-")}]
[${"abc"?left_pad(5, "-")}]
[${"abcd"?left_pad(5, "-")}]
[${"abcde"?left_pad(5, "-")}] 
[${""?left_pad(8, ".oO")}]
[${"a"?left_pad(8, ".oO")}]
[${"ab"?left_pad(8, ".oO")}]
[${"abc"?left_pad(8, ".oO")}]
[${"abcd"?left_pad(8, ".oO")}] 

h2. Replacing
${"this is a car acarus"?replace("car", "bulldozer")}
${"aaaaa"?replace("aaa", "X")}

h2. Replacing with flags (works with split and match methods as well)
[#assign s = 'foo bAr baar']
${s?replace('ba', 'XY')}
i: ${s?replace('ba', 'XY', 'i')}
if: ${s?replace('ba', 'XY', 'if')}
r: ${s?replace('ba*', 'XY', 'r')}
ri: ${s?replace('ba*', 'XY', 'ri')}
rif: ${s?replace('ba*', 'XY', 'rif')}  

h1. Regular expression
[#if "fxo"?matches("f.?o")]Matches.[#else]Does not match.[/#if]

[#assign res = "foo bar fyo"?matches("f.?o")]
[#if res]Matches.[#else]Does not match.[/#if]
Matching sub-strings:
[#list res as m]
- ${m}
[/#list]

h2. RegEx grouping

[#assign res = "aa/rx; ab/r;"?matches("(\\w[^/]+)/([^;]+);")]
[#list res as m]
- ${m} is ${m?groups[1]} per ${m?groups[2]}
[/#list]  

h1. String split
	
[#list "someMOOtestMOOtext"?split("MOO") as x]
- ${x}
[/#list]  


	
[/@plaintext.layout]
